<?php error_reporting (E_ALL ^ E_NOTICE);  // Remove unneeded notices?> 

<?php
    // Authored: Justin Lee for ICS 426
    // Sample of UH Login interface.    
    // Modded code from cas-demo.php by Russell Tokuyama
    include 'phpfunctions.php';  // includes Russell's php header code
?>
<html>
  <head>
    <title>ICS 426 Project</title>
  </head>
  <body>
    <h1></h1>
<!-- Beginning of Login Script -->
<?php
    if ($action == 'continue') { // if logged in display that user is logged in and a logout button
?>
<!-- Logged in representation -->
     <p>Welcome, <?php echo "$name"; ?>!
     <input type="button" value ="LOGOUT" onclick="location.href='<?php echo "$logout" ?>'" /></p>
<!-- End of Logged in representation -->
<?php
    }
    else {  // Either display invalid tickets or the a request for login
        if ($action == 'reuse_error') {
?>
     <p>Can't reuse service tickets!</p>
<?php
        }
?>
<!-- Not logged in representation -->
<p> Please login  <input type="button" value ="LOGIN" onclick="location.href='<?php echo"$login";?>'" /></p>
<!-- End of Not logged in representation -->
<?php  
    }  

?>
<!-- End of login script -->

    </body>
</html>

<?php
    //-------------------------------------------------------------
    // Copyright (c) 2011 University of Hawaii.  All rights reserved.
    //
    // Redistribution and use in source and binary forms, with or without
    // modification, are permitted provided that the following conditions
    // are met:
    //
    // 1. Redistributions of source code must retain the above copyright
    //    notice, this list of conditions and the following disclaimer.
    //
    // 2. Redistributions in binary form must reproduce the above copyright
    //    notice, this list of conditions and the following disclaimer in
    //    the documentation and/or other materials provided with the
    //    distribution.
    //
    // 3. Redistributions of any form whatsoever must retain the following
    //    acknowledgment:
    //    "This product includes software developed by the University of
    //    Hawaii (http://www.hawaii.edu/)."
    //
    // THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF HAWAII "AS IS" AND ANY
    // EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE UNIVERSITY OF HAWAII
    // OR THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
    // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
    // OF THE POSSIBILITY OF SUCH DAMAGE.
    //-------------------------------------------------------------
?>